<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>加入考试 - 在线考试系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
    <div class="container mt-5">
        <h1 class="text-center">欢迎，{{ username }}！</h1>
        <h2 class="text-center">班级: {{ class_name }}</h2>

        <div class="card p-4 mt-4">
            <form action="{{ url_for('student_class', username=username, class_name=class_name) }}" method="POST">
                <div class="mb-3">
                    <label for="exam_name" class="form-label">选择要加入的考试:</label>
                    <select id="exam_name" name="exam_name" class="form-control" required>
                        {% for exam in exams %}
                            <option value="{{ exam }}">{{ exam }}</option>
                        {% endfor %}
                    </select>
                </div>
                <button type="submit" class="btn btn-primary w-100">加入考试</button>
            </form>
        </div>

        {% if not exams %}
            <div class="alert alert-warning text-center mt-4">
                当前没有可参加的考试。
            </div>
        {% endif %}
    </div>
</body>
</html>
